<template>
  <tfoot>
    <tr v-show="list.length">
      <td colspan="5">
        <span>总分：{{ sumScore }}</span>
        <span style="margin-left: 50px"
          >平均分：{{
            list.length ? (sumScore / list.length).toFixed(2) : 0
          }}</span
        >
      </td>
    </tr>
  </tfoot>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: {
    list:{
      type:Array,
      require:true
    }
  },
  computed: {
    sumScore() {
      return this.list.reduce((sum, itme) => sum + itme.score, 0);
    },
  },
};
</script>

<style></style>
